<?php defined('IN_PHPCMS') or exit('No permission resources.'); ?><?php include template("content","head"); ?>
<!-- 主体 -->

<style>
</style>

<div class="container">
    <div class="mainOut">
        <div class="main public_2col">
            
            <div class="main_right grid_84 ov_h">
                <!-- InstanceBeginEditable name="EditRegion5" -->
                <div class="alltitle">
                <span class="crumbs">
                    您的位置： <a href="<?php echo siteurl($siteid);?>" title="首页">首页</a>
                    &nbsp;>&nbsp;<?php echo catpos($catid, $s = ' > ');?>&nbsp;
                </span>

                </div>


                <?php if($catid==13) { ?>
                <link rel="stylesheet" href="<?php echo LAY_PATH;?>css/layui.css">
                <div class="right">
                    <h2 style="font-size: 25px;margin-bottom: 20px"></h2>
                    <form id="form" class="layui-form">
                        <table class="layui-table" style="width: 600px;margin:auto">

                            <tr>
                                <td>姓名</td>
                                <td><input name="username" class="layui-input" type="text"></td>
                            </tr>
                            <tr>
                                <td>电话</td>
                                <td><input name="phone" class="layui-input" type="text"></td>
                            </tr>
                            <tr>
                                <td>Q Q</td>
                                <td><input name="qq" class="layui-input" type="text"></td>
                            </tr>
                            <tr>
                                <td>留言</td>
                                <td><textarea name="content" id="" cols="60" rows="5"></textarea></td>
                            </tr>

                            <tr>
                                <td>验证码：<?php echo form::checkcode('code_img', '4', '18', 84, 30);?></td>
                                <td><input name="code" class="layui-input" type="text"></td>
                            </tr>
                            <tr>
                                <td colspan="2"><button type="button" class="layui-btn tijiao1" style="background: #2f82ff;color:#fff;">提交</button></td>
                            </tr>
                            <input type="hidden" name="dosubmit" value="1">
                            <input type="hidden" name="ip" value="<?php echo ip();?>">
                        </table>
                    </form>
                </div>
                <?php } else { ?>
                <div class="news_list right_main pt25 pb15"> 
                    <p style="color:#999;font-size:14px;text-align:center;"><?php echo $inputtime;?> </p>
                    <div class="neirong">
                        <?php if($content) { ?>
						<?php echo $content;?>
						<?php } else { ?>
						<?php if(defined('IN_ADMIN')  && !defined('HTML')) {echo "<div class=\"admin_piao\" pc_action=\"content\" data=\"op=content&tag_md5=8bc53a4b2e46cbc59b7370c7bcde88d8&action=category&catid=%24catid&order=listorder+asc&num=1\"><a href=\"javascript:void(0)\" class=\"admin_piao_edit\">编辑</a>";}$content_tag = pc_base::load_app_class("content_tag", "content");if (method_exists($content_tag, 'category')) {$data = $content_tag->category(array('catid'=>$catid,'order'=>'listorder asc','limit'=>'1',));}?>
						<?php $n=1;if(is_array($data)) foreach($data AS $r) { ?>
						<?php if(defined('IN_ADMIN')  && !defined('HTML')) {echo "<div class=\"admin_piao\" pc_action=\"get\" data=\"op=get&tag_md5=99f2b5f981ac51d17d9d2f96f12b8280&sql=select+content+from+sy_page+where+catid%3D%24r%5Bcatid%5D&return=data1\"><a href=\"javascript:void(0)\" class=\"admin_piao_edit\">编辑</a>";}pc_base::load_sys_class("get_model", "model", 0);$get_db = new get_model();$r = $get_db->sql_query("select content from sy_page where catid=$r[catid] LIMIT 20");while(($s = $get_db->fetch_next()) != false) {$a[] = $s;}$data1 = $a;unset($a);?>
						<?php echo $data1['0']['content'];?>
						<?php if(defined('IN_ADMIN') && !defined('HTML')) {echo '</div>';}?>
						<?php $n++;}unset($n); ?>
						
						<?php if(defined('IN_ADMIN') && !defined('HTML')) {echo '</div>';}?>
						<?php } ?>
                    </div>
                    <div class="clear"></div>
				<style>
					.address{
						width:40%;
						float:left;
					}
					.ditu{
						width:56%;
						float:right;
					}
					.cle{
						clear:both;
						border-top:1px solid #999;
					}
					.jingli span{
						display:inline-block;
						margin-left:45px;
						width:200px;
						font-size:14px;
					}
					.er img{
						margin:10px 0 0 45px;
					}
				</style>
                </div>
                <?php } ?>
            </div>
			<div class="main_left grid_23 floatR ov_h">
                <div class="classify">
                    <h3>
                        联系我们
                        <p>Contact Us</p>
                    </h3>
                    <ul>
                        <?php if(defined('IN_ADMIN')  && !defined('HTML')) {echo "<div class=\"admin_piao\" pc_action=\"content\" data=\"op=content&tag_md5=8a51790d565756dbb71c83fd89381949&action=category&catid=4&order=listorder+asc\"><a href=\"javascript:void(0)\" class=\"admin_piao_edit\">编辑</a>";}$content_tag = pc_base::load_app_class("content_tag", "content");if (method_exists($content_tag, 'category')) {$data = $content_tag->category(array('catid'=>'4','order'=>'listorder asc','limit'=>'20',));}?>
                        <?php $n=1;if(is_array($data)) foreach($data AS $r) { ?>
                        <li  class="current">
                            <a href="<?php echo $r['url'];?>" title="<?php echo $r['catname'];?>" target="_self" class="<?php if($catid==$r[catid]) { ?>cur<?php } ?>"><?php echo $r['catname'];?></a>
                        </li>
                        <?php $n++;}unset($n); ?>
                        <?php if(defined('IN_ADMIN') && !defined('HTML')) {echo '</div>';}?>
                    </ul>
                </div>
                <?php include template("content","right"); ?>

            </div>
            <!--End left-->
        </div>
    </div>
    <!--End right-->
</div>
<script src="/statics/layui/layui.js"></script>
<script>
    $("#code").focus(function(){
        $(".myform").css('display','block')
    });
    $("#code").blur(function(){
        $(".myform").css('display','none')
    });
    layui.use(['form','layer'],function(){
        $('.tijiao1').click(function () {
            $.ajax({
                url:'index.php?m=webman&c=liuyan&a=add',
                type:'post',
                data:$('#form').serialize(),
                success:function(msg){
                    if(msg=='ok'){
                        layer.msg('提交成功，谢谢！',{icon:1}, function () {
                            location.reload()
                        });

                    }else if(msg=='fail'){
                        layer.msg('提交失败，请联系管理员',{icon:2});
                    }else{
                        layer.msg(msg,{icon:2})
                    }
                }
            })
        });
        $('.tijiao2').click(function () {
            $.ajax({
                url:'index.php?m=webman&c=liuyan&a=add',
                type:'post',
                data:$('#form2').serialize(),
                success:function(msg){
                    if(msg=='ok'){
                        layer.msg('提交成功，谢谢！',{icon:1});
                        location.reload()
                    }else if(msg=='fail'){
                        layer.msg('提交失败，请联系管理员',{icon:2});
                    }else{
                        layer.msg(msg,{icon:2})
                    }
                }
            })
        })
    })
</script>
<?php include template("content","foot"); ?>